import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import WindiCSS from 'vite-plugin-windicss'
// https://vitejs.dev/config/
import path from "path"
export default defineConfig({
  // 给文件根目录设置别名
  resolve:{
    alias:{
      "~":path.resolve(__dirname,"src")
    }
  },
  plugins: [uni(),WindiCSS()],
  // 配置代理
  server:{
    proxy:{
      '/api': {
        target: 'https://meituan.thexxdd.cn/',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
    }
  }
})
